home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / smaltalk / stv.lha / STV / st_v / util / STVUTIL7.ZIP / WIN31E.PRJ < prev    next >
Text File  |  1993-02-07  |  4KB  |  125 lines

  1. "
  2. ******************************************************************************
  3. Project : WIN31EXT.PRJ
  4. Date    : 'Jan 30, 1993'
  5. Time    : 18:10:43
  6.  
  7. Classes : 
  8.     ShellDLL MMLib 
  9.  
  10. Methods : 
  11.     #wmDropFiles:with: defined in TopPaneJR.
  12.  
  13. ******************************************************************************
  14. "!
  15.  
  16. "Initialize"
  17.  
  18.     WinEvents at: 563 put: #wmDropFiles:with:.
  19. !
  20.  
  21. DynamicLinkLibrary variableByteSubclass: #MMLib
  22.   classVariableNames: ''
  23.   poolDictionaries: ''!
  24.  
  25. DynamicLinkLibrary variableByteSubclass: #ShellDLL
  26.   classVariableNames: ''
  27.   poolDictionaries: ''!
  28.  
  29. Smalltalk at: #TopPaneJR ifAbsent: [
  30. TopPane subclass: #TopPaneJR
  31.   instanceVariableNames: ''
  32.   classVariableNames: ''
  33.   poolDictionaries: '']!
  34.  
  35.  
  36.  
  37. !ShellDLL class methods !
  38.  
  39. fileName
  40. "---------------------------------------------------------------------------------------------------------------------------------------------------------
  41. * Private *
  42.    -   This is the API class for Shell
  43. ---------------------------------------------------------------------------------------------------------------------------------------------------------"
  44.  
  45.     ^'SHELL.DLL'! !
  46.  
  47.  
  48.  
  49. !ShellDLL methods !
  50.  
  51. dragAcceptFiles: aWindowHandle bool: aBool
  52.     <api: '#9' ushort ushort none>
  53.     ^self invalidArgument!
  54.   
  55. dragQueryFile: wParam fileIndex: index fileBuffer: fb bufferSize: bufferSize
  56. "---------------------------------------------------------------------------------------------------------------------------------------------------------
  57. * Private *
  58.    -
  59. ---------------------------------------------------------------------------------------------------------------------------------------------------------"
  60.     <api: '#11' ushort short ulong ushort short>
  61.     ^self invalidArgument! !
  62.  
  63.  
  64.  
  65. !MMLib class methods !
  66.    
  67. fileName
  68. "---------------------------------------------------------------------------------------------------------------------------------------------------------
  69. * Private *
  70.    -   This is the API class for Mail
  71. ---------------------------------------------------------------------------------------------------------------------------------------------------------"
  72.  
  73.     ^'MMSYSTEM.DLL'! !
  74.  
  75.  
  76.  
  77. !MMLib methods !
  78.   
  79. sndPlaySound: aString flags: flagInteger
  80.  
  81.     <api: SNDPLAYSOUND struct ushort boolean>
  82.      ^self invalidArgument! !
  83.  
  84.  
  85. !TopPaneJR methods !
  86. wmDropFiles: wordInteger with: longInteger
  87. "---------------------------------------------------------------------------------------------------------------------------------------------------------
  88. * Private *
  89.    -  Someone dropped a file on us.
  90.    - If its a word macro file then invoke word with the macro file
  91. ---------------------------------------------------------------------------------------------------------------------------------------------------------"
  92.     |shell files size addr |
  93.  
  94.     shell := ShellDLL open.
  95.     files := shell dragQueryFile: wordInteger
  96.                                     fileIndex: 0 bitInvert asParameter
  97.                                     fileBuffer: 0
  98.                                     bufferSize: 0.
  99.     (files = 1)
  100.         ifTrue: [
  101.                      files := files - 1.
  102.                      size := (shell dragQueryFile: wordInteger
  103.                                             fileIndex: files asParameter
  104.                                             fileBuffer: 0
  105.                                             bufferSize: 0)+1.
  106.                       addr := WinAddress allocateMemory: size.
  107.                       shell dragQueryFile: wordInteger
  108.                                     fileIndex: files asParameter
  109.                                     fileBuffer: addr asParameter
  110.                                     bufferSize: size.
  111.                        MessageBox message: 'Someone dropped ', (String fromAddress: addr), ' file on me!!'
  112.                     ]!    !
  113. "construct application"
  114. ((Smalltalk at: #Application ifAbsent: [])
  115.     isKindOf: Class) ifTrue: [
  116.         ((Smalltalk at: #Application) for:'WIN31EXT.PRJ')
  117.             addClass: ShellDLL;
  118.             addClass: MMLib;
  119.             addMethod: #wmDropFiles:with: forClass: TopPaneJR;
  120.             comments: nil;
  121.             initCode: '    WinEvents at: 563 put: #wmDropFiles:with:.
  122. ';
  123.             finalizeCode: nil;
  124.             startUpCode: nil]!
  125.